package zhr.chapter8;

public class Example8_4 {
    public static void main(String[] args) {
        Integer[] iNums = {1, 2, 3, 4, 5, 6};
        Calc<? extends Number> c1 = null;
        c1 = new Calc<Integer>(iNums);
        System.out.println("整数组iNums的和值为" + c1.sum() + ",平均值为" + c1.average());
        Double[] dNums = {1.1, 2.2, 3.3, 4.4};
        c1 = new Calc<Double>(dNums);
        System.out.println("小数组dNums的和值为" + c1.sum() + ",平均值为" + c1.average());
    }
}
